<div class="panel panel-default search-panel">
    <div class="panel-body">
        <form class="form-inline">
            <div class="form-group">
                <select class="form-control" ng-model="query_host">
                    <option value="">选择主机</option>
                    <option ng-repeat="host in hosts" value="{{ host }}" ng-selected="query_host = host">{{ host }}</option>
                </select>
            </div>
            <div class="form-group">
                <select class="form-control" ng-model="query_available">
                    <option value="">选择状态</option>
                    <option value="true" ng-selected="query_available == 'true'">有效</option>
                    <option value="false" ng-selected="query_available == 'false'">无效</option>
                </select>
            </div>
            <div class="form-group">
                <select class="form-control" ng-model="query_solrVersion">
                    <option value="">选择Solr版本</option>
                    <option ng-repeat="solrVersion in solrVersions" value="{{ solrVersion }}" ng-selected="query_solrVersion == solrVersion">{{ solrVersion }}</option>
                </select>
            </div>
            <button type="submit" class="btn btn-default" ng-click="query()">查找</button>
        </form>
    </div>
</div>

<table class="table table-striped table-bordered table-hover">
    <tr>
        <th>主机</th>
        <th>状态</th>
        <th>Solr版本</th>
        <th>JVM版本</th>
        <th>JVM内存</th>
        <th>物理内存</th>
        <th>运行时间</th>
        <th>操作</th>
    </tr>
    <tr ng-repeat="node in paged.list">
        <td>{{ node.name }}</td>
        <td>
            <span class="label label-success" ng-show="node.available">有效</span>
            <span class="label label-danger" ng-show="!node.available">无效</span>
        </td>
        <td>{{ node.solrSpecVersion }}</td>
        <td>{{ node.jvmVersion }}</td>
        <td>{{ (monitorMap[node.id].jvmUsedMemory / 1024 / 1024) | number:2 }}M / {{ (monitorMap[node.id].jvmMaxMemory / 1024 / 1024)  | number:2}}M</td>
        <td>{{ ((monitorMap[node.id].systemTotalPhysicalMemory - monitorMap[node.id].systemFreePhysicalMemory) / 1024 / 1024) | number:2 }}M / {{ (monitorMap[node.id].systemTotalPhysicalMemory / 1024 / 1024) | number:2 }}M</td>
        <td>
            <span ng-if="node.jvmUptime >= (24 * 3600 * 1000)">{{(node.jvmUptime / (24 * 3600 * 1000)) | number:0}}天{{((node.jvmUptime / (3600 * 1000)) % 24) | number:0}}</span>
            <span ng-if="node.jvmUptime < (24 * 3600 * 1000)">{{(node.jvmUptime / (3600 * 1000)) | number:0}} 小时</span>
        </td>
        <td>
            <button type="button" class="btn btn-danger" ng-if="!node.available" ng-click="confirmRemove(node)">删除</button>
        </td>
    </tr>
</table>
<div>
    <div ng-include="'app/common/view/paged.html'"></div>
    <div class="clearfix"></div>
</div>
